#pragma once

#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>

using namespace std;

class Util{
public:
    static bool StringSplit(const string& str, const string& sep, vector<string>* result){
        size_t start = 0;
        while(start < str.size()){
            auto pos = str.find(sep, start);
            if(pos == string::npos)
                break;
            result->push_back(str.substr(start, pos - start));
            start = pos + sep.size();
        }
        if(start < str.size())
            result->push_back(str.substr(start));
        return true;
    }

    static int toInt(const string& s){
        return atoi(s.c_str());
    }
};
